package com.mk.cloud.pt.controller.app;

import act.apidoc.Description;
import act.controller.Controller;
import act.handler.NonBlock;
import act.util.CacheFor;
import com.mk.cloud.common.domain.PTeamArea;
import com.mk.cloud.common.interceptor.header.HeaderService;
import com.mk.cloud.common.interceptor.header.IHLogin;
import com.mk.cloud.common.util.ResUtils;
import org.osgl.http.H;
import org.osgl.mvc.annotation.GetAction;
import org.osgl.mvc.annotation.With;

import javax.inject.Inject;

@Controller("app/teamArea")
public class PTeamAreaController extends HeaderService {

    @Inject
    private PTeamArea.Mapper pTeamAreaMapper;

    @Description("分组区域")
    @GetAction("teamareas.json")
    @With(IHLogin.class)
    @CacheFor(value = 10 * 60)
    @NonBlock
    public String getPTeamAreaList(){
        PTeamArea teamArea = new PTeamArea();
        teamArea.setCoid(me.getCoid());
        return ResUtils.OK(pTeamAreaMapper.template(teamArea));
    }
}
